package net.neptech.repository;
import net.neptech.entity.Conference;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Optional;


public interface ConferenceRepository extends JpaRepository<Conference, Long> {

    /**
     * 根据 conferenceId 查询会议
     */
    Optional<Conference> findByConferenceId(String conferenceId);

    /**
     * 可选：自定义查询（如果需要返回特定字段）
     */
    @Query("SELECT c FROM Conference c WHERE c.conferenceId = :conferenceId AND c.status = 0")
    Optional<Conference> findActiveByConferenceId(@Param("conferenceId") String conferenceId);
}